package com.pms.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.pms.entity.Ideas;
import com.pms.entity.Project;

import com.pms.service.IdeaService;
import com.pms.util.GetSession;


public class Idea extends HttpServlet {


	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		
		Project pro = (Project)GetSession.getSession(request).getAttribute("pro");
		String proid=pro.getPro_id();
		
		IdeaService ideas=new IdeaService();
		List<Ideas> ideaList=ideas.findByProid(proid);
		
		GetSession.getSession(request).setAttribute("ideaList", ideaList);
		request.setAttribute("ideaList",ideaList);
		//Users user = (Users)GetSession.getSession(request).getAttribute("user");
		//setUserid(user.getUser_id());
		
		request.getRequestDispatcher("WEB-INF/idea.jsp").forward(request, response);
	}

}
